<template>
 <!-- 头部部分 -->
 <header class="header">
      <h1>todos</h1>
      <input class="new-todo" 
      v-model.trim="Taskname" 
      @keydown="Atask" 
      placeholder="请输入任务名称" autofocus />
    </header>
</template>

<script>
export default {

  data() {
    return {

      Taskname:''
    };
  },
 methods:{
  Atask(){
    if(this.Taskname === '') return
    this.$emit('TaskName', this.Taskname),
    this.Taskname=''
  }
 }
};
</script>

<style  scoped>

</style>